{{Extend "layout"}}
{{Block "title"}}{{if HasSuffix URL.Path "_add"}}{{"添加属性"|T}}{{else}}{{"修改属性"|T}}{{end}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li><a href="__BACKEND__/official/pay/product_index">{{"产品管理"|T}}</a></li>
<li><a href="__BACKEND__/official/pay/product_attr_index">{{"属性管理"|T}}</a></li>
<li class="active">{{if HasSuffix URL.Path "_add"}}{{"添加"|T}}{{else}}{{"修改"|T}}{{end}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
    <div class="col-md-12">
        <div class="block-flat">
          <div class="header">							
            <h3>{{if HasSuffix URL.Path "_add"}}{{"添加属性"|T}}{{else}}{{"修改属性"|T}}{{end}}</h3>
          </div>
          <div class="content">
              <form class="form-horizontal group-border-dashed" parsley-validate novalidate method="POST" action="">
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"属性组"|T}}</label>
                <div class="col-sm-3">{{$groupId:=(Formx "groupId").Uint}}
                  <select class="form-control" name="groupId" id="groupId">
                    <option value=""> - {{"请选择"|T}} -</option>
                    {{range $k, $v := Stored.groupList}}
                    <option value="{{$v.Id}}"{{if eq $v.Id $groupId}} selected{{end}}>{{$v.Name}}</option>
                    {{end}}
                  </select>
                  <div class="help-block">{{"属性所属组"|T}}</div>
                </div>
                <label class="col-sm-2 control-label">{{"排序"|T}}</label>
                <div class="col-sm-3">
                  <input type="number" class="form-control" name="sort" value="{{Form "sort"}}" />
                  <div class="help-block">{{"从小到大排列"|T}}</div>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"属性名称"|T}}</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="name" value="{{Form "name"}}">
                    <div class="help-block">{{"属性中文名称"|T}}</div>
                </div>
                <label class="col-sm-2 control-label">{{"属性标识"|T}}</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" name="ident" value="{{Form "ident"}}">
                    <div class="help-block">{{"唯一英文标识"|T}}</div>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"说明"|T}}</label>
                <div class="col-sm-8">
                  <textarea class="form-control" name="description">{{Form "description"}}</textarea>
                  <div class="help-block">{{"功能说明"|T}}</div>
                </div>
              </div>
              <div class="form-group">
                  <label class="col-sm-2 control-label">{{"图标"|T}}</label>
                  <div class="col-sm-8">
                      <input type="text" class="form-control" name="icon" value="{{Form "icon"}}">
                      <div class="help-block">{{"图标类名"|T}}</div>
                  </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"状态"|T}}</label>
                <div class="col-sm-3">
                  {{$v := Form "disabled"}}
                  <div class="radio radio-success radio-inline">
                    <input type="radio" value="N" id="disabled-N" name="disabled"{{if or (eq $v "N") (eq $v "")}} checked{{end}}> <label for="disabled-N">{{"启用"|T}}</label>
                  </div>
                  <div class="radio radio-danger radio-inline">
                    <input type="radio" value="Y" id="disabled-Y" name="disabled"{{if eq $v "Y"}} checked{{end}}> 
                    <label for="disabled-Y">{{"禁用"|T}}</label>
                  </div>
                </div>
                <label class="col-sm-2 control-label">{{"显示为特色功能"|T}}</label>
                <div class="col-sm-3">
                  {{$v := Form "isFeature"}}
                  <div class="radio radio-success radio-inline">
                    <input type="radio" value="N" id="isFeature-N" name="isFeature"{{if or (eq $v "N") (eq $v "")}} checked{{end}}> <label for="isFeature-N">{{"否"|T}}</label>
                  </div>
                  <div class="radio radio-success radio-inline">
                    <input type="radio" value="Y" id="isFeature-Y" name="isFeature"{{if eq $v "Y"}} checked{{end}}> 
                    <label for="isFeature-Y">{{"是"|T}}</label>
                  </div>
                </div>
              </div>
              <div class="form-group form-submit-group">
									<div class="col-sm-9 col-sm-offset-2">
									  <button type="submit" class="btn btn-primary btn-lg"><i class="fa fa-save"></i> {{"保存"|T}}</button>
									  <button type="reset" class="btn btn-default btn-lg"><i class="fa fa-refresh"></i> {{"重置"|T}}</button>
									</div>
							</div>
            </form>
          </div><!-- /.content -->
        </div><!-- /.block-flat -->
    </div>
</div>
{{/Block}}